#!/usr/env/bin python
# -*- coding: utf-8 -*-

# @Time    : 2020-10-12 10:01 上午
# @Author  : yangdy
# @File    : 1603. 设计停车系统
# @Software: PyCharmCE
class ParkingSystem:

    def __init__(self, big: int, medium: int, small: int):
        self.big = big
        self.medium = medium
        self.small = small

    def addCar(self, carType: int) -> bool:
        types = ['', 'big', 'medium', 'small']
        cars = getattr(self, types[carType])
        if cars > 0:
            setattr(self, types[carType], cars-1)
            return True
        return False

        # if carType == 1:
        #     if self.big > 0:
        #         self.big -= 1
        #         return True
        #     else:
        #         return False
        # elif carType == 2:
        #     if self.medium > 0:
        #         self.medium -= 1
        #         return True
        #     else:
        #         return False
        # elif carType == 3:
        #     if self.small > 0:
        #         self.small -= 1
        #         return True
        #     else:
        #         return False


# Your ParkingSystem object will be instantiated and called as such:
# obj = ParkingSystem(big, medium, small)
# param_1 = obj.addCar(carType)